<!--志愿服务-->
<template>
  <div>
      <el-card class="box-card" shadow="never">
        <el-tabs v-model="activeName" @tab-click="handleClick">
          <el-tab-pane label="服务项目" name="servicelist">
            <router-view  v-if="show_service_list"/>
          </el-tab-pane>
          <el-tab-pane label="报名列表" name="signlist">
            <router-view v-if="show_sign_list"/>
          </el-tab-pane>

        </el-tabs>
      </el-card>
  </div>
</template>

<script>
  export default{
    name:'Volunteer',
    data(){
      return {
         activeName: 'servicelist',
         show_service_list:true,
         show_sign_list:false
      }
    },
    created(){
         this.$router.push('/volunteer/servicelist');
    },
    methods:{
       handleClick(tab, event) {
          let tag_name=tab.name;
          if(tag_name=='servicelist'){
             this.show_service_list=true;
             this.show_sign_list=false;
          }else if(tag_name=='signlist'){
             this.show_sign_list=true;
             this.show_service_list=false;
          }
          this.$router.push({
            name:tag_name
          });
       }
    }
  }
</script>

<style>
</style>
